<?php 
namespace app\http\controller;

use think\facade\View;
 use think\cache\driver\Redis;
class Index 
{
	public function Index(){
 
    echo "dsfsdf";
		 $redis =new redis();
		 $redis->set("k",'测试');
		 
		 $redis->psubscribe((array('__keyevent@0__:expired'), $this->keyCallback);
 
		return View::fetch();
	}
public	function keyCallback($redis, $pattern, $chan, $msg)
	{
	    echo "Pattern: $pattern\n";
	    echo "Channel: $chan\n";
	    echo "Payload: $msg\n\n";
	}
		
	public function show(){
		
		 $redis =new redis();
		  
	 
		$redis->set("k",'测试');
	}
	
}



